<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>

<div ng-switch="isCompleted()">

    <div ng-switch-when="true" ng-switch="hasErrors">

        <div class="message message-error" ng-switch-when="true">
            <span class="message-text">
                <strong>Completed!</strong> You need to resolve these issues to continue.
            </span>
        </div>

        <div class="message message-success" ng-switch-default>
            <span class="message-text">
                <strong>Completed!</strong> You can now move on to the next step.
            </span>
        </div>

    </div>

    <div class="message message-spinner" ng-switch-default>
        <span class="spinner">
            <span></span><span></span><span></span><span></span>
            <span></span><span></span><span></span><span></span>
        </span>
        <span class="message-text">Checking and Creating Backup...</span>
    </div>

</div>

<div id="backup-check" class="readiness-check-item" ng-show="check.visible">
    <div ng-hide="check.processed">
        <span class="spinner side">
            <span></span><span></span><span></span><span></span>
            <span></span><span></span><span></span><span></span>
        </span>
        <h3 class="readiness-check-title">Checking available disk space for backups</h3>
    </div>
    <div ng-show="check.processed" ng-switch="check.responseType">

        <div ng-switch-when="success" ng-init="updateOnSuccess(check)">

            <span class="readiness-check-icon icon-success-round"></span>

            <div class="readiness-check-content">
                <h3 class="readiness-check-title">Disk space available</h3>
                <p>
                    You have enough space available in disk for taking your selected backups.
                </p>
            </div>

        </div>

        <div class="readiness-check-item" ng-switch-default ng-init="updateOnError(check)">

            <span class="readiness-check-icon icon-failed-round"></span>

            <div class="readiness-check-content">
                <h3 class="readiness-check-title">Check disk space availability</h3>
                <p>
                    Insufficient disk space available. Free up some space and try the backup again.
                </p>
                <p>
                    Error received from server:
                    <br>
                    {{check.error}}
                </p>
            </div>
        </div>

    </div>

</div>

<div id="store-maintenance" class="readiness-check-item" ng-show="maintenance.visible">
    <div ng-hide="maintenance.processed">
        <span class="spinner side">
            <span></span><span></span><span></span><span></span>
            <span></span><span></span><span></span><span></span>
        </span>
        <h3 class="readiness-check-title">Putting store in maintenance mode...</h3>
    </div>
    <div ng-show="maintenance.processed" ng-switch="maintenance.responseType">

        <div ng-switch-when="success" ng-init="updateOnSuccess(maintenance)">

            <span class="readiness-check-icon icon-success-round"></span>

            <div class="readiness-check-content">
                <h3 class="readiness-check-title">Store in maintenance mode</h3>
                <p>
                    Your store is in maintenance mode and will automatically
                    return online after the {{type}}.
                </p>
            </div>

        </div>

        <div class="readiness-check-item" ng-switch-default ng-init="updateOnError(maintenance)">

            <span class="readiness-check-icon icon-failed-round"></span>

            <div class="readiness-check-content">
                <h3 class="readiness-check-title">Check store maintenance availability</h3>
                <p>
                    Cannot put your store in maintenance mode. Please fix that, and try again.
                </p>
                <p>
                    Error received from server:
                    <br> {{maintenance.error}}
                </p>
            </div>
        </div>

    </div>

</div>

<div id="backup-create" class="readiness-check-item" ng-show="create.visible">
    <div ng-hide="create.processed">
        <span class="spinner side">
            <span></span><span></span><span></span><span></span>
            <span></span><span></span><span></span><span></span>
        </span>
        <h3 class="readiness-check-title">Creating Backup...</h3>
    </div>
    <div ng-show="create.processed" ng-switch="create.responseType">

        <div ng-switch-when="success" ng-init="updateOnSuccess(create)">

            <span class="readiness-check-icon icon-success-round"></span>

            <div class="readiness-check-content" ng-show="backupInfoPassed.options.code || backupInfoPassed.options.media || backupInfoPassed.options.db">
                <h3 class="readiness-check-title">Backup created</h3>
                <p>The backup files can be found in Magento Admin's backup management.</p>
                <p>The backup files are located in:</p>
                <p> {{files}} </p>
            </div>
        </div>
        <div class="readiness-check-item" ng-switch-default ng-init="updateOnError(create)">

            <span class="readiness-check-icon icon-failed-round"></span>

            <div class="readiness-check-content">
                <h3 class="readiness-check-title">Backup failed</h3>
                <p>
                    Error received from server:
                    <br> {{create.error}}
                </p>
            </div>
        </div>
    </div>
</div>
